const seq = require('../db_connect'),
      { STRING, INT, DOUBLE } = require('../../configs/db_type');

const allBook = seq.define('allbook', {
  bid: {
  	comment: 'book ID',
  	type: INT,
  	allowNull: false,
  	unique: true
  },
  field: {
	comment: 'the book concerned the tab',
	type: INT,
	defaultValue: 0,
	allowNull: false
  },
  imgUrl: {
  	comment: 'book detail page link',
  	type: STRING,
  	allowNull: false
  },
  bookTitle: {
  	comment: 'book name',
  	type: STRING,
  	allowNull: false
  },
  bookPrice: {
  	comment: 'book price',
  	type: DOUBLE,
  	allowNull: false
  },
  imgKey: {
  	comment: 'book description',
  	type: STRING,
  	allowNull: false
  },
  status: {
  	comment: 'book status',
  	type: INT,
  	defaultValue: 1,
  	allowNull: false
  }
});

module.exports = allBook;















